<template>
    <LeaveNoteEdit 
        :editLeveNoteId="leaveNoteId" 
        :memorialId="memorialId" 
        :type="type" 
        @back-to-list="handleBackToList" 
    />
</template>

<script setup lang="ts">
import LeaveNoteEdit from '@/components/leaveNote/edit.vue'
import { useRouter, useRoute } from 'vue-router'
import { computed } from 'vue'

const router = useRouter()
const route = useRoute()

const memorialId = computed(() => route.query.memorialId as string)
const leaveNoteId = computed(() => route.query.leaveNoteId as string)
const type = computed(() => route.query.type as string)

const handleBackToList = () => {
    router.push({
        path: '/memorialManage/leaveNoteList',
        query: { memorialId: memorialId.value }
    })
}
</script>